#pragma once
#include <memory>

#ifdef STRING_ALLOC_DEBUG
extern long int stringsAllocated;
#endif

class AdderString
{
public:
	AdderString();
	AdderString(const AdderString& c);
	AdderString(const char* str);
	~AdderString();

	AdderString& operator <<(const AdderString& b);
	AdderString& operator <<(float b);
	AdderString& operator <<(int b);
	AdderString& operator <<(unsigned int b);
	AdderString& operator <<(const char * b);
	AdderString& operator +=(const AdderString& b);
	AdderString& operator =(const AdderString& b);
	bool operator ==(const AdderString& b) const;
	bool operator ==(const char * b) const;
	bool operator !=(const AdderString& b) const;
	bool operator !=(const char * b) const;
	bool operator <(const AdderString& b) const;
	bool operator >(const AdderString& b) const;
	bool operator <=(const AdderString& b) const;
	bool operator >=(const AdderString& b) const;
	const char* c_str();
	std::auto_ptr<char> substr(unsigned int start, unsigned int count);
	char at(unsigned int pos);
	unsigned int size();
	unsigned int memsize();
private:
	char * data;
	bool freed;
	unsigned int string_length;
	unsigned int block_size;
};
